var mysql = require("mysql");
var connection = mysql.createConnection({
    host:"127.0.0.1",
    port:"3306",
    user:"root",
    password:"123",
    database:"testdb"
});

connection.connect();

connection.query("select * from user",function(error,result,fileds){
    if(error)throw error;

    console.log("result = ",result);

});

connection.end();
